<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('实时成绩')" />
    <style>
        .main-ctn{
            padding: 20px;
            font-size: 16px;
        }
        .screen-list{
            padding: 10px;
            display: flex;
            align-items: center;
        }
        .place-list{
            display: flex;
        }
        .place{
            border: 1px solid #ccc;
            border-radius: 5px;
            padding: 5px 20px;
            margin-left: 10px;
            cursor: pointer;
            font-size: 14px;
        }
    </style>
</head>
<body>
    <div class="main-ctn">

        <div class="screen-list">
            <div class="txt">投屏成绩:</div>
            <div class="place-list">
                <div class="place" onclick="screenScore(this)">全部场地</div>
                <div class="place" onclick="screenScore(this)" th:each="place : ${placeList}" th:data-place-id="${place.id}">[[${place.name}]]</div>
            </div>
        </div>

        <div class="screen-list">
            <div class="txt">投屏排名:</div>
            <div class="place-list">
                <div class="place" onclick="screenRanking(this)">全部场地</div>
                <div class="place" onclick="screenRanking(this)" th:each="place : ${placeList}" th:data-place-id="${place.id}">[[${place.name}]]</div>
            </div>
        </div>

    </div>



    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "js/score";

        function screenScore(evt) {
            var placeId = $(evt).attr("data-place-id");
            var path = prefix + "/screenScore";
            if(placeId){
                path += "?placeId=" + placeId;
            }
            window.open(path);
        }

        function screenRanking(evt) {
            var placeId = $(evt).attr("data-place-id");
            var path = prefix + "/screenRanking";
            if(placeId){
                path += "?placeId=" + placeId;
            }
            window.open(path);
        }

    </script>
</body>
</html>